﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.Collections.Generic;
using YXShop.Model.Order;

namespace YXShop.Web.product
{
    public partial class makeorders : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //查检购物车是否存在数据
                ProfileCommon Profile = new ProfileCommon();
                ICollection<CartItemInfo> cart = Profile.ShoppingCart.CartItems;
                if (cart.Count < 1)
                {
                    ChangeHope.WebPage.Script.AlertAndGoBack("温馨提示：购物车没有商品不能进行提交！");
                }
                if (ChangeHope.WebPage.PageRequest.GetInt("UserId") <= 0)
                {
                    ChangeHope.WebPage.Script.AlertAndRedirect("请先登录", "../membercenter/login.aspx");
                }

                if (ChangeHope.WebPage.PageRequest.GetFormString("Option") != "")
                {
                    string types = Request.Form["Option"].Trim();
                    if (types == "Province")
                    {
                        string ProvinceId = Request.Form["ProvinceId"].Trim();
                        Response.Write(YXShop.Common.Province.Provinces_City("", ProvinceId));
                    }
                    if (types == "Citys")
                    {
                        string CitysId = Request.Form["CitysId"].Trim();
                        Response.Write(YXShop.Common.Province.Provinces_Borough("", CitysId));
                    }
                    Response.End();
                    return;
                }
                Response.Write(YXShop.TemplateAction.Common.YXShop_PageContent("submitorder"));
            }
        }
       


      
    }
}
